<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>专线添加</title>
  <link href="/assets/css/admin/reset.css" rel="stylesheet" type="text/css">
  <link href="/assets/css/admin/zh-cn-system.css" rel="stylesheet" type="text/css">
  <link href="/assets/css/admin/table_form.css" rel="stylesheet" type="text/css">
  <link rel="stylesheet" type="text/css" href="/assets/css/admin/style/zh-cn-styles1.css" title="styles1" media="screen">
  <link rel="alternate stylesheet" type="text/css" href="/assets/css/admin/style/zh-cn-styles2.css" title="styles2" media="screen">
  <link rel="alternate stylesheet" type="text/css" href="/assets/css/admin/style/zh-cn-styles3.css" title="styles3" media="screen">
  <link rel="alternate stylesheet" type="text/css" href="/assets/css/admin/style/zh-cn-styles4.css" title="styles4" media="screen">
  <script type="text/javascript" src="/assets/js/admin/jquery.min.js"></script>
  <script type="text/javascript" src="/assets/js/admin/jquery.cookie.js"></script>
  <script type="text/javascript" src="/assets/js/admin/styleswitch.js"></script>
  <script type="text/javascript" src="/assets/js/admin/admin_common.js"></script>
  <script language="javascript" type="text/javascript" src="/assets/js/admin/formvalidator.js" charset="UTF-8"></script>
  <script language="javascript" type="text/javascript" src="/assets/js/admin/formvalidatorregex.js" charset="UTF-8"></script>

    <style type="text/css">
         select,input{
            width:300px;
            height: 30px;
        }
         input[type="radio"]{
             width: auto;
             height: auto;
         }
    </style>
</head>
<body>
  <div class="subnav">
    <div class="content-menu ib-a blue line-x">
      <a class="add fb" href="/Admin/Zhuanxian/add"><em>添加专线</em></a>&nbsp;&nbsp;&nbsp;<a class="" href="/Admin/Zhuanxian/index"><em>专线管理</em></a>
    </div>
  </div>
  <style type="text/css">
  html{_overflow-y:scroll}
  </style>
  <div class="pad-lr-10">
      <form  action="/Admin/Zhuanxian/edit/nid/<?php echo ($_GET['nid']); ?>" method="post" onsubmit="return chked()">

          <table cellpadding=0 cellspacing=0 class="table_form" width="100%">

              <tr>
                  <td width="10%" align="right">渠道：</td>
                  <td width="90%">
                      <select name="channel_id" id="channel" required="" oninvalid="setCustomValidity('请选择渠道');" oninput="setCustomValidity('')">
                          <option value="">请选择</option>
                          <?php if(is_array($channel)): foreach($channel as $key=>$val): if($val['id']==$arr[0]['channel_id']): ?><option value="<?php echo ($val['id']); ?>" selected><?php echo ($val['company']); ?></option>
                                  <?php else: ?>
                                  <option value="<?php echo ($val['id']); ?>" ><?php echo ($val['company']); ?></option><?php endif; endforeach; endif; ?>
                      </select>
                  </td>
              </tr>
              <tr>
                  <td width="10%" align="right">分区：</td>
                  <td width="90%">
                      <select name="partition_id" id="partition" required="" oninvalid="setCustomValidity('请选择渠道');" oninput="setCustomValidity('')">
                          <?php if(is_array($partition)): foreach($partition as $key=>$val): if($val['id']==$arr[0]['partition_id']): ?><option value="<?php echo ($val['id']); ?>" selected><?php echo ($val['partition']); ?></option>
                                  <?php else: ?>
                                  <option value="<?php echo ($val['id']); ?>"><?php echo ($val['partition']); ?></option><?php endif; endforeach; endif; ?>
                      </select>
                  </td>
              </tr>
              <tr>
                  <td width="10%" align="right">国家：</td>
                  <td width="90%">
                      <select name="country_id" id="country" required="" oninvalid="setCustomValidity('请选择国家');" oninput="setCustomValidity('')">
                          <option value="">请选择</option>
                          <?php if(is_array($country)): foreach($country as $key=>$val): if($val['id']==$arr[0]['country_id']): ?><option value="<?php echo ($val[id]); ?>" selected><?php echo ($val['ename']); ?>&nbsp;&nbsp;<?php echo ($val['cname']); ?></option>
                                  <?php else: ?>
                                  <option value="<?php echo ($val[id]); ?>"><?php echo ($val['ename']); ?>&nbsp;&nbsp;<?php echo ($val['cname']); ?></option><?php endif; endforeach; endif; ?>
                      </select>
                  </td>
              </tr>
              <tr>
                  <td width="10%" align="right">计算方式：</td>
                  <td width="90%">
                      <input type="text" name="method" id="method" class="input-text" value="<?php echo ($arr[0]['']); ?>"/>
                  </td>
              </tr>
              <tr>
                  <td width="10%" align="right">注意事项：</td>
                  <td width="90%">
                      <textarea name="announcements" id="announcements" style="width:300px;height:70px;resize:none;" cols="50" rows="10"><?php echo ($arr[0]['announcements']); ?></textarea>
                  </td>
              </tr>
              <tr>
                  <td width="10%" align="right">时效：</td>
                  <td width="90%">
                      <input type="text" name="prescription" id="Prescription" class="input-text" value="<?php echo ($arr[0]['prescription']); ?>"/>
                  </td>
              </tr>
              <tr>
                  <td width="10%" align="right">燃油：</td>
                  <td width="90%">
                      <input type="number" step="0.01" min="0"  class="input-text" name="fuel" id="fuel" value="<?php echo ($arr[0]['fuel']); ?>"/>
                  </td>
              </tr>
              <?php if($arr[0]['type']==1): ?><tr>
                      <td></td>
                      <td>
                          <input type="radio" name="type" id="you" value="1" checked/>有续重&nbsp;&nbsp;
                          <input type="radio"name="type" id="wu" value="0"/>无续重
                      </td>
                  </tr>
                  <tr>
                      <td width="10%" align="right">底重：</td>
                      <td width="90%">
                          <input type="number" step="0.01" min="0" class="input-text" name="start_weight" id="start_weight" value="<?php echo ($arr[0]['start_weight']); ?>"  required="" oninvalid="setCustomValidity('请输入底重');" oninput="setCustomValidity('')"/>kg<span></span>
                      </td>
                  </tr>
                  <tr>
                      <td width="10%" align="right">单/底价：</td>
                      <td width="90%">
                          <input type="number" step="0.01" min="0"  class="input-text" name="start_fare" id="start_fare" value="<?php echo ($arr[0]['start_fare']); ?>"  required="" oninvalid="setCustomValidity('请输入底价');" oninput="setCustomValidity('')"/>RMB<span></span>
                      </td>
                  </tr>
                  <tr>
                      <td width="10%" align="right">每重量段最小重：</td>
                      <td width="90%">
                          <input type="number" step="0.01" min="0"  class="input-text" name="stage_min_weig" id="stage_min_weig" value="<?php echo ($arr[0]['stage_min_weig']); ?>" required="" oninvalid="setCustomValidity('请输入每重量段最小重');" oninput="setCustomValidity('')"/>kg<span></span>
                      </td>
                  </tr>
                  <tr>
                      <td width="10%" align="right">每重量段最大重：</td>
                      <td width="90%">
                          <input type="number" step="0.01" min="0"  class="input-text" name="stage_max_weig" id="stage_max_weig" value="<?php echo ($arr[0]['stage_max_weig']); ?>"  required="" oninvalid="setCustomValidity('请输入每重量段最大重');" oninput="setCustomValidity('')"/>kg<span></span>
                      </td>
                  </tr>
                  <tr>
                      <td width="10%" align="right">续重：</td>
                      <td width="90%">
                          <input type="number" step="0.01" min="0"  class="input-text" name="add_weig" id="add_weig" value="<?php echo ($arr[0]['add_weig']); ?>"  required="" oninvalid="setCustomValidity('请输入续重');" oninput="setCustomValidity('')"/>kg<span></span>
                      </td>
                  </tr>
                  <tr>
                      <td width="10%" align="right">续重价：</td>
                      <td width="90%">
                          <input type="number" step="0.01" min="0"  class="input-text" name="add_weig_price" id="add_weig_price" value="<?php echo ($arr[0]['add_weig_price']); ?>"  required="" oninvalid="setCustomValidity('请输入续重价');" oninput="setCustomValidity('')"/>RMB <span></span>
                      </td>
                  </tr>
              <?php else: ?>
                  <tr>
                      <td></td>
                      <td>
                          <input type="radio" name="type" id="you" value="1" />有续重&nbsp;&nbsp;
                          <input type="radio"name="type" id="wu" value="0"checked/>无续重
                      </td>
                  </tr>
                  <tr>
                      <td width="10%" align="right">底重：</td>
                      <td width="90%">
                          <input type="number" step="0.01" min="0" class="input-text" name="start_weight" id="start_weight" value="<?php echo ($arr[0]['start_weight']); ?>"  required="" oninvalid="setCustomValidity('请输入底重');" oninput="setCustomValidity('')"/>kg<span></span>
                      </td>
                  </tr>
                  <tr>
                      <td width="10%" align="right">单/底价：</td>
                      <td width="90%">
                          <input type="number" step="0.01" min="0"  class="input-text" name="start_fare" id="start_fare" value="<?php echo ($arr[0]['start_fare']); ?>"  required="" oninvalid="setCustomValidity('请输入底价');" oninput="setCustomValidity('')"/>RMB<span></span>
                      </td>
                  </tr>
                  <tr>
                      <td width="10%" align="right">每重量段最小重：</td>
                      <td width="90%">
                          <input type="number" step="0.01" min="0"  class="input-text" name="stage_min_weig" id="stage_min_weig" value="<?php echo ($arr[0]['stage_min_weig']); ?>" required="" oninvalid="setCustomValidity('请输入每重量段最小重');" oninput="setCustomValidity('')"/>kg<span></span>
                      </td>
                  </tr>
                  <tr>
                      <td width="10%" align="right">每重量段最大重：</td>
                      <td width="90%">
                          <input type="number" step="0.01" min="0"  class="input-text" name="stage_max_weig" id="stage_max_weig" value="<?php echo ($arr[0]['stage_max_weig']); ?>"  required="" oninvalid="setCustomValidity('请输入每重量段最大重');" oninput="setCustomValidity('')"/>kg<span></span>
                      </td>
                  </tr>
                  <tr style="display: none">
                      <td width="10%" align="right">续重：</td>
                      <td width="90%">
                          <input type="number" step="0.01" min="0"  class="input-text" name="add_weig" id="add_weig" value="<?php echo ($arr[0]['add_weig']); ?>"  required="" oninvalid="setCustomValidity('请输入续重');" oninput="setCustomValidity('')"/>kg<span></span>
                      </td>
                  </tr>
                  <tr style="display: none">
                      <td width="10%" align="right">续重价：</td>
                      <td width="90%">
                          <input type="number" step="0.01" min="0"  class="input-text" name="add_weig_price" id="add_weig_price" value="<?php echo ($arr[0]['add_weig_price']); ?>"  required="" oninvalid="setCustomValidity('请输入续重价');" oninput="setCustomValidity('')"/>RMB <span></span>
                      </td>
                  </tr><?php endif; ?>


          </table>
          <div class="bk15"></div>
          <div class="btn">
              <input type="submit" name="dosubmit" id="dosubmit" value="提交" class='button'>&nbsp;<input type="reset" value="重置" class='button'>
          </div>
      </form>
  </div>
  <script type="text/javascript">

      function chked(){

      }
      $("#wu").change(function(){
          if($("#wu").prop("checked")){

             /* $("#stage_min_weig").val("0").parent().parent().css("display","none");
              $("#stage_max_weig").val("0").parent().parent().css("display","none");*/
              $("#add_weig").val("0").parent().parent().css("display","none");
              $("#add_weig_price").val("0").parent().parent().css("display","none");
          }
      })
      $("#you").change(function(){
          if($("#you").prop("checked")){
              /*$("#stage_min_weig").val("").parent().parent().css("display","");
              $("#stage_max_weig").val("").parent().parent().css("display","");*/
              $("#add_weig").val("").parent().parent().css("display","");
              $("#add_weig_price").val("").parent().parent().css("display","");
          }
      })
  </script>
</body>
</html>